﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using iBackupExplorer.Pages;

namespace iBackupExplorer
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        private void Application_DispatcherUnhandledException_1(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            CatchException(e.Exception);
            e.Handled = true;
        }

        private static void CatchException(Exception ex)
        {
            Task.Factory.StartNew(() => Utils.Utils.LogException(ex,string.Empty));
            new MessageBoxYesNo(ex.Message, false, true).ShowDialog();
        }
    }
}
